<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const person = {
        eays: 2,
        head: 1,
      };
      // 女人 构造函数 继承 想要 继承person
      function Woman() {}
      //   Woman通过原型来继承person
      Woman.prototype = person;
      // 指回原来构造函数
      Woman.prototype.constructor = Woman;
      const erd = new Woman();
      console.log(erd);
      console.log(Woman.prototype);
      // 男人构造函数 继承 想要 继承person
      function Man() {}
      // 通过原型继承person
      Man.prototype = person;
      Man.prototype.constructor = Man;
      const pink = new Man();
      console.log(pink);
    </script>
  </body>
</html>
